var teamId;
var tmGameId;
var startDate;
var endDate;
var tmScoreListId;
var itemId;
var itemType;
var currentTab;
var playUserId;
var backURL;
var gameDataList={};
$(document).ready(function(){ 
	$.ajaxSettings.async = false;
	$('#header').animate({'top':'0px'},400);
	teamId = args.teamId; //取得id的值
	tmGameId = args.tmGameId;
	startDate = args.startDate;
	endDate = args.endDate;
	tmScoreListId = args.tmScoreListId;
	itemId = args.itemId;
	itemType = args.itemType;
	currentTab = args.currentTab;
	playUserId = args.playUserId;
	backURL = args.backURL;
	defaultTab=args.defaultTab;
	
	var paraData = {teamId:teamId,tmGameId:tmGameId,startDate:startDate,endDate:endDate,tmScoreListId:tmScoreListId,playUserId:playUserId,itemId:itemId,itemType:itemType};
	$.getJSON(path+"/soccer/tmGameDataAction!selectGameDataList.action",paraData, function(data){
		gameDataList = data.gameDataList;
	  	var gameDataHtml=[];
	  	$.each(gameDataList,function(index,obj){
	  		var indexNo = index+1;
	  		gameDataHtml.push("<tr>");
	  		gameDataHtml.push("<td nowrap='nowrap' style='color:yellow'>"+indexNo+"</td>");
	  		gameDataHtml.push("<td nowrap='nowrap' style='color:yellow'>"+moment(obj.tmGameDate,"YYYY-MM-DD").format("YYYY-MM-DD")+"</td>");
	  		gameDataHtml.push("<td nowrap='nowrap' style='color:yellow'>"+obj.tmGameName+"</td>");
	  		gameDataHtml.push("<td nowrap='nowrap' style='color:yellow'>"+obj.itemName+"</td>");
	  		gameDataHtml.push("<td nowrap='nowrap' style='color:yellow'>"+obj.itemValue+"</td>");
	  		gameDataHtml.push("</tr>");
	  	});
	  	$("#gameDataBody").html(gameDataHtml.join("")); 
	});
	
});
function goBack(){
	var timestamp = (new Date()).valueOf();
	window.location.href=path+backURL+"?teamId="+teamId+"&tmGameId="+tmGameId+"&tmScoreListId="+tmScoreListId
	+"&startDate="+startDate+"&endDate="+endDate+"&backURL="+backURL+"&defaultTab="+currentTab+"&timestamp="+timestamp;
}
